package com.candy.candyproductservice.service;

import com.candy.candycommon.utils.ResultBean;
import com.candy.candyproductservice.dto.ProductDTO;
import com.candy.candyproductservice.lowerRank.ProductServiceLowerRank;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "product", value = "candy-product", path = "product", fallback = ProductServiceLowerRank.class)
public interface ProductService {

    @RequestMapping("getByOrderId")
    ResultBean getByOrderId(@RequestParam Long orderId);

    @PostMapping("subProduct")
    public ResultBean subProduct(@RequestBody ProductDTO productDTO);

    @PostMapping("subProduct2")
    public void subProduct2(@RequestBody ProductDTO productDTO);

}
